package com.ruoyi.service.fanruan.impl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.domain.jpjs.common.fanruan.WyFirst;
import com.ruoyi.mapper.fanruan.WyFirstMapper;
import com.ruoyi.service.fanruan.IWyFirstService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 物业集团Service业务层处理
 *
 * @author ruoyi
 * @date 2020-11-04
 */
@Service
@Transactional(rollbackFor = Exception.class)
@DataSource(value = DataSourceType.SLAVE)
public class WyFirstServiceImpl implements IWyFirstService
{
    @Autowired
    private WyFirstMapper wyFirstMapper;

    /**
     * 查询物业集团
     *
     * @param id 物业集团ID
     * @return 物业集团
     */
    @Override
    public WyFirst selectWyFirstById(Long id)
    {
        return wyFirstMapper.selectWyFirstById(id);
    }

    /**
     * 查询物业集团列表
     *
     * @param wyFirst 物业集团
     * @return 物业集团
     */
    @Override
    public List<WyFirst> selectWyFirstList(WyFirst wyFirst)
    {
        return wyFirstMapper.selectWyFirstList(wyFirst);
    }

    /**
     * 新增物业集团
     *
     * @param wyFirst 物业集团
     * @return 结果
     */
    @Override
    public int insertWyFirst(WyFirst wyFirst)
    {
        return wyFirstMapper.insertWyFirst(wyFirst);
    }

    /**
     * 修改物业集团
     *
     * @param wyFirst 物业集团
     * @return 结果
     */
    @Override
    public int updateWyFirst(WyFirst wyFirst)
    {
        return wyFirstMapper.updateWyFirst(wyFirst);
    }

    /**
     * 删除物业集团对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWyFirstByIds(String ids)
    {
        return wyFirstMapper.deleteWyFirstByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除物业集团信息
     *
     * @param id 物业集团ID
     * @return 结果
     */
    @Override
    public int deleteWyFirstById(Long id)
    {
        return wyFirstMapper.deleteWyFirstById(id);
    }
}
